package com.atguigu.gulimall.product.controller;

import com.atguigu.gulimall.product.entity.CategoryEntity;
import com.atguigu.gulimall.product.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * spring-cache 使用redis作为缓存组件
 *
 *
 * @author dengwei
 * @email dengwei@gmail.com
 * @date 2024-04-06 03:17:30
 */
@RestController
@RequestMapping("product/demo")
public class DemoController {

    @Autowired
    private CategoryService categoryService;

    @GetMapping("/demo1")
    public List<CategoryEntity> demo1() {
        List<CategoryEntity> categoryEntityList = this.categoryService.getLevel1CategoryListForDemo();
        return categoryEntityList;
    }
}
